// @ts-ignore
/* eslint-disable */
import { request } from 'umi';

/** 新增角色 POST /role/add */
export async function insertRoleUsingPost(body: API.RoleVO, options?: { [key: string]: any }) {
  return request<API.TradeResult>('/role/add', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 角色分配菜单 POST /role/allot/menu */
export async function allotMenusToRoleUsingPost(
  body: API.RoleAuthorityVO,
  options?: { [key: string]: any },
) {
  return request<API.TradeResult>('/role/allot/menu', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 删除角色 POST /role/delete */
export async function deleteRoleUsingPost1(body: string[], options?: { [key: string]: any }) {
  return request<API.TradeResult>('/role/delete', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 查询角色列表 POST /role/list */
export async function fetchRoleListUsingPost(
  body: API.PageBeanRoleListQuery_,
  options?: { [key: string]: any },
) {
  return request<API.TradeResult>('/role/list', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 修改角色 POST /role/update */
export async function updateRoleUsingPost1(body: API.RoleVO, options?: { [key: string]: any }) {
  return request<API.TradeResult>('/role/update', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}
